home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Sample Code / Codecs / examplecodec / examplecodec.r < prev    next >
Encoding:
Text File  |  1993-06-23  |  2.7 KB  |  117 lines  |  [TEXT/MPS ]

  1.  
  2.  
  3. #include "Types.r"
  4. #include "MPWTypes.r"
  5. #include "ImageCodec.r"
  6.  
  7.  
  8. #define    exampleCodecFormatName            "Example - YUV"
  9.  
  10.  
  11. #define    exampleCodecFormatType    'exmp'
  12.  
  13.  
  14. /*
  15.  
  16.     This structure defines the capabilities of the codec. There will 
  17.     probably be a tool for creating this resource, which measures the performance
  18.     and capabilities of your codec.
  19.     
  20. */
  21. resource 'cdci' (128, "Example CodecInfo",locked) {
  22.     exampleCodecFormatName,                            /* name of the codec TYPE ( data format ) */
  23.     1,                                                /* version */                            
  24.     1,                                                /* revision */    
  25.     'appl',                                            /* who made this codec */
  26.     codecInfoDoes32 + codecInfoDoesSpool,                /* depth and etc. supported directly on decompress */    
  27.     codecInfoDoes32 + codecInfoDoesSpool,                /* depth and etc supported directly on compress */
  28.     codecInfoDepth16,                                /* which data formats do we understand */
  29.     100,                                            /* compress accuracy (0-255) (relative to format) */
  30.     100,                                            /* decompress accuracy (0-255) (relative to format) */
  31.     200,                                            /* millisecs to compress 320x240 image on base Mac */
  32.     200,                                            /* millisecs to decompress 320x240 image on base Mac */
  33.     100,                                            /* compression level (0-255) (relative to format) */
  34.     0,                                
  35.     2,                                                /* minimum height */
  36.     2,                                                /* minimum width */
  37.     0,
  38.     0,
  39.     0
  40. };
  41.  
  42.  
  43.  
  44. resource 'thng' (128,  "Example Compressor",locked) {
  45.     compressorComponentType,
  46.     exampleCodecFormatType,
  47.     'appl',
  48.     codecInfoDoes32,
  49.     0,
  50.     'cdec',
  51.     128,
  52.     'STR ',
  53.     128,
  54.     'STR ',
  55.     129,
  56.     'ICON',
  57.     128
  58. };
  59.  
  60. resource 'thng' (130,  "Example Decompressor",locked) {
  61.     decompressorComponentType,
  62.     exampleCodecFormatType,
  63.     'appl',
  64.     codecInfoDoes32,
  65.     0,
  66.     'cdec',
  67.     128,
  68.     'STR ',
  69.     130,
  70.     'STR ',
  71.     131,
  72.     'ICON',
  73.     130
  74. };
  75.  
  76.  
  77. resource 'ICON' (128, purgeable) {
  78.     $"0003 8000 0004 C000 0004 C000 0004 C000"
  79.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  80.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  81.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  82.     $"0004 C000 0004 C000 0004 C000 0007 C000"
  83.     $"0008 6000 0018 7000 007F FC00 00C0 1E00"
  84.     $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
  85.     $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
  86. };
  87.  
  88. resource 'STR ' (128) {
  89.     "My Example Compressor"
  90. };
  91.  
  92. resource 'STR ' (129) {
  93.     "Compresses (in an exemplar fasion) an image into a YUVish format."
  94. };
  95.  
  96.  
  97. resource 'ICON' (130, purgeable) {
  98.     $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
  99.     $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
  100.     $"0008 6000 0018 7000 007F FC00 00C0 1E00"
  101.     $"0004 C000 0004 C000 0004 C000 0007 C000"
  102.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  103.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  104.     $"0004 C000 0004 C000 0004 C000 0004 C000"
  105.     $"0003 8000 0004 C000 0004 C000 0004 C000"
  106. };
  107.  
  108. resource 'STR ' (130) {
  109.     "My Example Decompressor"
  110. };
  111.  
  112. resource 'STR ' (131) {
  113.     "Decompresses an image conmpressed in YUVish format."
  114. };
  115.  
  116.  
  117.